<%@ page language="java" pageEncoding="UTF-8"%>

<div ng-controller="DiscussIndexController">
	<div class="row">
		<div ng-repeat="plane in discuss.plane" class="col-md-5" ng-class="{true:'pull-left',false:'pull-right'}[$index%2==0]">

			<div style="color: #666;font-weight: bold;">
				<span class="pull-left">
					{{plane.forum.name}}
				</span>
				<span class="pull-right">
					<a ng-href="#/discuss/forum/{{plane.forum.id}}">更多»</a>
				</span>
				<br/>
				<hr/>
			</div>
			
			<div ng-repeat="dis in plane.discuss">
			
				<div class="pull-left">
					<a ng-href="#/discuss/{{dis.id}}" ng-style="{'color':dis.order.color,'font-weight':dis.order.font}" title="{{dis.title | textOnly}}">
						{{dis.title | summary:20}}
					</a>
				</div>
				
				<div class="pull-right" ng-show="$index!=0">
					{{dis.create_time | formatDate:true}}
				</div>
				
				<div ng-show="$index==0" style="color: #777;padding-top: 30px;">
					{{dis.content | textOnly | summary:80}}
				</div>
				
				<br/>
			</div>
		</div>
	</div>
	<br/>
	
	<div class="panel panel-default" ng-repeat="vertical in discuss.vertical">
		<div class="panel-heading">
			{{vertical.forum.name}}
			<span class="pull-right">
				<a ng-href="#/discuss/forum/{{vertical.forum.id}}">进入{{vertical.forum.name}}»</a>
			</span>
		</div>
		<div class="panel-body">
			<table class="table table-hover">
				<tr ng-repeat="dis in vertical.discuss">
					<td>
						<div class="pull-left">
							<i class="glyphicon glyphicon-file"  ng-show="dis.order.name==null"></i>
							
							<span ng-show="dis.order.name!=null">
								<span class="label label-default">{{dis.order.name}}</span>
							</span>
							
							<a ng-href="#/discuss/{{dis.id}}" ng-style="{'color':dis.order.color,'font-weight':dis.order.font}" title="{{dis.title | textOnly}}">
								{{dis.title | summary:80}}
							</a>
							
							<span style="color: #777;margin-left: 10px;">
								{{dis.last_time | formatDate:true}} By {{dis.author.username}}
							</span>
						</div>
						
						<div class="pull-right" style="color: #777;">
							{{dis.comment_count}}回 / {{dis.views_count}}阅
						</div>
					</td>
				</tr>
			</table>
		</div>
		<br/>
	</div>
	
</div>